package testGroovy;

import java.net.InetAddress;

public class TestIPAvailable {
	public static void main(String[] args){
		InetAddress address;
		try {
			address = InetAddress.getByName("117.187.10.140");
			System.out.println("Reach: " + address.isReachable(1000)); // 是否能通信 返回true或false
			System.out.println("Name: " + address.getHostName());
			System.out.println("Addr: " + address.getHostAddress());
			System.out.println(address.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
